#include <iostream>
#include <vector>
using namespace  std;
class Solution {
public:
	int firstUniqChar(string s) {
		vector<int> iv(26, 0);
		for(auto&i:s)
		{
			iv[i - 'a']++;
			cout << i << "\t" << iv[i - 'a'] << endl;
		}
		for(auto i=0;i<s.size();++i)
		{
			if (iv[s[i]-'a'] == 1)
				return i;
		}
		return -1;
	}
};
int main()
{
	cout << Solution().firstUniqChar("leetcode")<<endl;
	return 0;
}